<%@ page import="edu.zut.pojo.SysUser" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    SysUser sysUser = new SysUser(1, "jack", 20);
    SysUser sysUser2 = new SysUser(2, "tom", 21);
    request.setAttribute("sysUser",sysUser);
    List<SysUser> list = new ArrayList<>();
    list.add(sysUser);
    list.add(sysUser2);
    request.setAttribute("list",list);
    Map<String,SysUser> map = new HashMap<>();
    map.put("one",sysUser);
    map.put("two",sysUser2);
    request.setAttribute("map",map);
    request.setAttribute("num1",100);
    request.setAttribute("num2",200);
%>
<%--数据是对象  key.属性名   默认会调用对应属性的get方法--%>
<p>用户id:${sysUser.id}</p>
<p>用户名：${sysUser.name}</p>
<p>年龄：${sysUser.age}</p>
<%--数据是集合或者数组时，通过下标--%>
<p>${list[0].name}</p>
<p>${list[0].age}</p>
<p>${list[1].name}</p>
<p>${list[1].age}</p>
<%--数据是map,根据key取值即可--%>
<p>map.1.name:${map.one.name}</p>
<p>map.1.age:${map.one.age}</p>
<p>map.2.name:${map.two.name}</p>
<p>map.2.age:${map.two.age}</p>
<%--el可以取值，也可以运算、逻辑运算--%>
<p>num1 + num2 = ${num1 + num2}</p>
<p>num == num2 : ${num1 == num2}</p>
<%--判断是否为空--%>
${num1 == null || num1 == ""}
${empty num1}
<%--实际中，数组、集合、map需要遍历  所以学习jstl--%>

</body>
</html>
